//
//  BaseTableViewCell,TableViewCell.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/4/18.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit
import SnapKit
enum OrderSelectType {
    case orderEntrust
    case orderPosition
    case orderHistory
}
class BaseTableViewCell: UITableViewCell {
    lazy var line:UIView = {
        let line:UIView = UIView()
        line.themeBackground = ThemeManager.ThemeColorKeys.tabLineColor
        
        return line
    }()
    
    lazy var nameLabel: UILabel = {
        let label = BaseLabel(style: .oneStyle)
        label.font = UIFont.systemFont(ofSize: 15)
        return label
    }()
    
    lazy var arrowImage: UIImageView = {
        let imageView = UIImageView()
        return imageView
    }()
    
    lazy var kindLabel: UILabel = {
        let label = BaseLabel(style: .twiceStyle)
        label.font = UIFont.systemFont(ofSize: 12)
        return label
    }()
    
    lazy var  iconImage: UIImageView = {
        let imageView = UIImageView()
        return imageView
    }()
    
    lazy var backArrorImage: UIImageView = {
        let imageView = UIImageView()
        imageView.image = #imageLiteral(resourceName: "arrow_right")
        return imageView
    }()
    
    lazy var switBtn:UISwitch = {
        let switchBtn =  UISwitch()
        return switchBtn
    }()
    
    //勾选
    lazy var selectImage: UIImageView = {
        let imageView = UIImageView()
        return imageView
    }()
    
    var selectStateBool = false //标记是否被选中
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.contentView.themeBackground = ThemeManager.ThemeColorKeys.background
        self.selectedBackgroundView = UIView(frame: self.bounds)
        self.selectedBackgroundView?.themeBackground = ThemeManager.ThemeColorKeys.selectTabColor
        self.setUpUI()
    }
    func setUpUI() -> Void {
        self.contentView.addSubview(line)
        line.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(16)
            make.bottom.equalToSuperview().offset(-0.5)
            make.right.equalToSuperview()
            make.height.equalTo(0.5)
        }
        
        self.contentView.addSubview(nameLabel)
        nameLabel.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(16)
            make.centerY.equalToSuperview()
        }
        
        
    }
//    override func layoutSubviews() {
//        super.layoutSubviews()
//        self.contentView.width = kSCREEN_WIDTH
//    }
//    
    func setArrowImage() {
        self.contentView.addSubview(backArrorImage)
        backArrorImage.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(-16)
        }
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    func setModel(model:BaseModel) -> Void {
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
